#include "Frm07.h"

Frm07::Frm07(HmiApp* app, STTWidget *par, const string& id, const string& desc) : STTPage(app->getRuntime(), par, id, desc) {
	hmiApp = app;
}

Frm07::~Frm07() {
}

void Frm07::onInit() {

}

void Frm07::createParts() {
	setMainArg(0, 0, 1024, 600);
	setMainStyle(0, 0xffffff, 0xffffff, 0, 255, 0, 0xc0c0c0);

	/*----------------------------- Label : wMLabel1                     -----------------------------*/
	wMLabel1 = new STTLabel(p_rt, this, "wMLabel1");
	wMLabel1->setMainArg(237, 0, 137, 43, "文字阴影", TextAlign::LEFT, LabelLongMode::CLIP, 30);
	wMLabel1->setFonts(0x0, 16, "文泉驿微米黑", 0);
	wMLabel1->setMainStyle(0, 0xffffff, 0xffffff, GradDir::NONE, 0, 0x0, 0);
	wMLabel1->setFormatText(TextAlign::LEFT, LabelLongMode::CLIP, 30);

	/*----------------------------- Label : wMLabel2                     -----------------------------*/
	wMLabel2 = new STTLabel(p_rt, this, "wMLabel2");
	wMLabel2->setMainArg(237, 41, 137, 43, "文字阴影", TextAlign::LEFT, LabelLongMode::CLIP, 30);
	wMLabel2->setFonts(0xff0000, 16, "文泉驿微米黑", 0);
	wMLabel2->setMainStyle(0, 0xffffff, 0xffffff, GradDir::NONE, 0, 0x0, 0);
	wMLabel2->setFormatText(TextAlign::LEFT, LabelLongMode::CLIP, 30);

	/*----------------------------- Label : wMLabel3                     -----------------------------*/
	wMLabel3 = new STTLabel(p_rt, this, "wMLabel3");
	wMLabel3->setMainArg(0, 104, 1024, 39, "多颜色文本（以#xxxxxx 开始，以#结束）", TextAlign::LEFT, LabelLongMode::CLIP, 30);
	wMLabel3->setFonts(0x0, 16, "文泉驿微米黑", 0);
	wMLabel3->setMainStyle(0, 0xffffff, 0xffffff, GradDir::NONE, 0, 0x0, 0);
	wMLabel3->setFormatText(TextAlign::LEFT, LabelLongMode::CLIP, 30);

	/*----------------------------- Button : wMButton3                   -----------------------------*/
	wMButton3 = new STTButton(p_rt, this, "wMButton3", 0);
	wMButton3->setMainArg(1, 1, 98, 48, false);
	wMButton3->setPressedArg("返回主页", 0x0, "文泉驿微米黑", 16, 0);
	wMButton3->setPressedStyle(8, 255, 0xebebeb, 0x999999, 1, 1, 0x999999, 1, 0xebebeb);
	wMButton3->setReleasedArg("返回主页", 0x0, "文泉驿微米黑", 16, 0);
	wMButton3->setReleasedStyle(5, 255, 0xebebeb, 0x999999, 1, 1, 0x999999, 1, 0xebebeb);
	wMButton3->bindOpenFormHandler(Event::CLICKED, "Frm03", PageMode::NEWWIN, NULL);

	/*called after widget created.*/

	return; //createParts END
}
#include "base/Constants.h"
void Frm07::onLoad() {
	wMLabel2->getStyle()->p_text->setOpa(130);//透明度，作为阴影效果
	wMLabel2->alignTo(wMLabel1, stt::constant::ALIGN::TOP_LEFT, 1, 1);//x,y各偏移
	wMLabel2->moveToIndex(0);//阴影移至底层
	wMLabel2->getStyle()->p_text->setColor(0xff0000);//设置阴影颜色
	wMLabel3->setRecolor(true);
	wMLabel3->setMainArg(225, 42, 371, 39, "#ff0000 多##00ff00 颜色##0000ff 文本#（以井号xxxxxx [注意有空格]开始，以井号结束）", TextAlign::LEFT, LabelLongMode::CLIP, 30);

}

bool Frm07::onClosing() {
	return true;
}

void Frm07::onDispose() {

}
